/***************************************************************************
 * File name: EPubBase.h
 * Original author: caizhifei2003@163.com
 * Date: 2013.03.01
 ***************************************************************************/
#ifndef _EPUB_BASE_H_
#define _EPUB_BASE_H_

#include "EPubTypes.h"

class EPubBase
{
public:
	EPubBase() : m_RefCount(0) { }
	virtual ~EPubBase() { }

	void AddRef() { ++m_RefCount; }

	bool Release()
	{
		--m_RefCount;

		if (!m_RefCount) {
			delete this;
			return true;
		}

		return false;
	}

	EPUB_Int32 GetRefCount() const { return m_RefCount; }


private:
	EPUB_Int32			m_RefCount;
};

#endif // _EPUB_BASE_H_